home *** CD-ROM | disk | FTP | other *** search
- // Filename: VIEW.WMC
- // "DOCTEMP" Generated by Visual Programmer.
- // Author: Blue Sky
-
- //
- // ***********************************************************************
- // Do not add code here. Add code in the .CPP file.
- //
- // This file is maintained by the Switch-It Module.
- // As you make changes in your applications design,
- // this file is automatically updated, therefore you never modify this file.
- //
- //
- //
- // For more information,
- // see the section "How code is generated" in the documentation.
- //
- // ***********************************************************************
- //
-
-
- // ----------------------------------------------------------------------------
- #ifndef WMCLASSONLY
- // ----------------------------------------------------------------------------
-
-
-
-
- // *************************************************************
- // Member Functions for Class: Cwm_VIEWBaseWnd
- // Base Class : CEditView
- // *************************************************************
-
-
- CString Cwm_VIEWBaseWnd::ms_strWndClass; //Window Class Name
-
-
- IMPLEMENT_DYNCREATE(Cwm_VIEWBaseWnd, CEditView)
-
- BEGIN_MESSAGE_MAP(Cwm_VIEWBaseWnd, CEditView)
-
- ON_REGISTERED_MESSAGE(wPrivateMessage,SimHandlePrivateMessage)
-
- END_MESSAGE_MAP()
-
-
-
- Cwm_VIEWBaseWnd::Cwm_VIEWBaseWnd()
- : CEditView()
- {
-
- ms_pToolbarTop= ms_pToolbarBottom=ms_pToolbarLeft=ms_pToolbarRight=NULL;
- ms_pWndClient = NULL;
-
-
- if (ms_strWndClass.IsEmpty())
- SimRegisterClass();
-
- }
-
-
-
- Cwm_VIEWBaseWnd::~Cwm_VIEWBaseWnd()
- {
- }
-
-
-
- BOOL Cwm_VIEWBaseWnd::SimRegisterClass()
- {
- WNDCLASS WndClass;
-
- WndClass.lpszClassName = "BLD_VIEW";
- WndClass.style = CS_DBLCLKS;
- WndClass.cbClsExtra = 0;
- WndClass.cbWndExtra = 0;
- WndClass.hInstance = AfxGetInstanceHandle();
- WndClass.hIcon = LoadIcon(NULL,IDI_APPLICATION);
- WndClass.hCursor = LoadCursor(NULL,IDC_ARROW);
- WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
- WndClass.lpszMenuName = NULL;
-
- if (!ms_strWndClass.IsEmpty())
- return TRUE; // Already registered
-
- ms_strWndClass = AfxRegisterWndClass(WndClass.style,
- WndClass.hCursor, WndClass.hbrBackground, WndClass.hIcon);
-
- if (ms_strWndClass.IsEmpty())
- return FALSE;
- else
- return TRUE;
- }
-
-
-
- BOOL Cwm_VIEWBaseWnd::SimInitWindow(CWnd *pAParent)
- {
- CREATESTRUCT sCr;
-
- if (ms_strWndClass.IsEmpty())
- return FALSE;
-
- sCr.lpCreateParams = NULL;
- sCr.hInstance = AfxGetInstanceHandle();
- sCr.dwExStyle = 0;
- sCr.lpszClass = ms_strWndClass;
- sCr.lpszName = "VIEW";
- sCr.style = WS_CHILD | WS_CAPTION | WS_THICKFRAME | WS_CLIPSIBLINGS | WS_SYSMENU;
- sCr.hwndParent = pAParent ? pAParent->GetSafeHwnd() : (HWND)NULL;
- sCr.x = CW_USEDEFAULT;
- sCr.y = 0;
- sCr.cx = CW_USEDEFAULT;
- sCr.cy = 0;
- sCr.hMenu = NULL;
-
-
- CCreateContext CContext;
-
- // MFC needs a pointer to a CCreateContext
- CContext.m_pNewViewClass =NULL;
- CContext.m_pCurrentDoc =NULL;
- CContext.m_pNewDocTemplate=NULL;
- CContext.m_pLastView =NULL;
- CContext.m_pCurrentFrame =NULL;
-
- if (!Create(NULL,NULL,AFX_WS_DEFAULT_VIEW,
- CRect(0,0,0,0),pAParent,AFX_IDW_PANE_FIRST,&CContext))
- {
- BLDDisplayMessage(::GetActiveWindow(),BLD_CannotCreateWindow,"VIEW",
- MB_OK | MB_ICONASTERISK);
- return FALSE;
- }
-
- ShowWindow(SW_SHOW);
- UpdateWindow();
-
- if (pAParent)
- {
- if (pAParent->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
- {
- CFrameWnd* pFrame;
- pFrame = (CFrameWnd*)pAParent;
- pFrame->RecalcLayout();
- }
- }
-
- return TRUE;
- }
-
-
-
- // PreCreateWindow - overridden for window to get correct properties
- BOOL Cwm_VIEWBaseWnd::PreCreateWindow(CREATESTRUCT& sCr)
- {
- return CEditView::PreCreateWindow(sCr);
- }
-
-
-
- void Cwm_VIEWBaseWnd::OnDraw(CDC* pDC)
- {
- }
-
-
-
-
- LRESULT Cwm_VIEWBaseWnd::SimHandlePrivateMessage(WPARAM wParam,LPARAM lParam)
- {
- LPBLDSetChildDialog lpSetChildDialog;
- switch(wParam)
- {
- case SIM_GETCHILDDIALOG:
- switch(LOWORD(lParam))
- {
- case 0: //Client area controls
- return (LRESULT)(LPSTR)(CSimClientDlg*)ms_pWndClient;
- case CBRS_RIGHT:
- return (LRESULT)(LPSTR)(CSimToolbar*)ms_pToolbarRight;
- case CBRS_LEFT:
- return (LRESULT)(LPSTR)(CSimToolbar*)ms_pToolbarLeft;
- case CBRS_BOTTOM:
- return (LRESULT)(LPSTR)(CSimToolbar*)ms_pToolbarBottom;
- case CBRS_TOP:
- return (LRESULT)(LPSTR)(CSimToolbar*)ms_pToolbarTop;
- }
- break;
- case SIM_SETCHILDDIALOG:
- lpSetChildDialog = (LPBLDSetChildDialog)lParam;
- switch(lpSetChildDialog->nStyle)
- {
- case 0: //Client area controls
- ms_pWndClient = (CSimClientDlg*)lpSetChildDialog->pWnd;
- break;
- case CBRS_RIGHT:
- ms_pToolbarRight = (CSimToolbar*)lpSetChildDialog->pWnd;
- break;
- case CBRS_LEFT:
- ms_pToolbarLeft = (CSimToolbar*)lpSetChildDialog->pWnd;
- break;
- case CBRS_BOTTOM:
- ms_pToolbarBottom = (CSimToolbar*)lpSetChildDialog->pWnd;
- break;
- case CBRS_TOP:
- ms_pToolbarTop = (CSimToolbar*)lpSetChildDialog->pWnd;
- break;
- }
- break;
- case SIM_RELOADACCELERATORS:
- break;
- case SIM_LOADACCELTABLE:
- return 0;
- break;
- }
- return 0;
- }
-
-
- // ----------------------------------------------------------------------------
- #endif //WMCLASSONLY
- // ----------------------------------------------------------------------------
-
-